<?php 
	global $ubi;
	$urlLoad =  'index.php?quickMessage&type=loadAll&userid=' . $getVars['userid'];
	$urlDelete = 'index.php?remove&type=quick_message';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Ubiquitous</title>
    <link href="include/css/style.css" rel="stylesheet" type="text/css" />       
    <link rel="stylesheet" href="include/css/jquery-ui.css" type="text/css" />
    <link rel="stylesheet" href="include/css/comments.css" type="text/css" />
        
	<script language="javascript" src="include/script/jquery-1.4.4.min.js" type="text/javascript"></script>
	<script language="javascript" src="include/script/jquery.corner.js" type="text/javascript"></script>    
	<script type="text/javascript" src="include/script/jquery-ui-1.8.14.custom.min.js"></script>
	<script type="text/javascript" src="include/script/script.js"></script>    
    <!--[if lte IE 6]>
        <script type="text/javascript" src="include/css/supersleight-min.js"></script>
        <link href="css/ie6.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <script language="javascript" type="text/javascript">
		$(document).ready(function(){
			$('#footer').corner('5px');
			$('#allQuickMessages').load('<?php echo $urlLoad?>');
			$('a.page').click(function(event) {
				var page = $(this).html();
				var url = "<?php echo $urlLoad?>" + "&page=" + page;
				$('#allQuickMessages').load(url);
				$('a.page').each(function(){
					$(this).removeAttr("style");
				});					
				$(this).attr("style", "font-weight:bold");
			});			
		});


		$.extend({
			deleteQuickMessage:function(id,reId,url) {				
				var page = $('a.page[style]').html();
				var isLast = false;
				if ($('.oneComment').length == 1) {
					if (page > 1) {
						page = page - 1;
					}
					isLast = true;
				}				
				$.post(url,
					{id:id,reId:reId},
					function(data) {						
						if (data) {
							var nMess = $('#nNewMessage').html();
							$('#nNewMessage').html(nMess - 1);	
							if (isLast) {
								$('a.page').last().remove();
								$('a.page').last().attr("style", "font-weight:bold");
							}													
							$('#allQuickMessages').load('<?php echo $urlLoad ?>' + '&page=' + page);							
						}
					}
				);
			}	
		});		
    </script>
    
</head>

<body>
<div id="main"><!-- Main starts here -->
<?php
	require_once $ubi['SERVER']['SERVER_ROOT'] . '/template/header.php';	 
?>
<div class="clear"></div>
<div class="contentTop"></div>
<div class="content">
    <div class="organic">    	
    	<div style="margin-left:60px; margin-top:10px; line-height:1.2em">
    		Hiện tại có <span id="nNewMessage"><?php echo $nQuickMessage?></span> tin nhắn nhanh				
    	</div>
    	<div id="allQuickMessages"></div>
		
		<div class="page">
			Trang : <a class="page" href="#allQuickMessages" style="font-weight:bold">1</a>&nbsp;
			<?php
				for ($i = 1; $i < $numberOfPages; $i++) {				
			?>
					<a class="page" href="#allQuickMessages"><?php echo $i + 1 ?></a>&nbsp;
			<?php
				} 
			?>
		</div>
	</div> 
    <div class="space"></div>    
</div>    
     
<div class="clear"></div>

<div class="contentBottom"></div>

<?php
	require_once $ubi['SERVER']['SERVER_ROOT'] . '/template/footer.php'; 
?>

</div><!-- Main ends here -->
</body>
</html>